home *** CD-ROM | disk | FTP | other *** search
- unit Unit1;
-
- interface
-
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls;
-
- type
- TForm1 = class(TForm)
- Button1: TButton;
- Edit1: TEdit;
- Edit2: TEdit;
- Label1: TLabel;
- Label2: TLabel;
- procedure Button1Click(Sender: TObject);
-
- private
- { Private declarations }
- public
- { Public declarations }
- end;
-
- var
- Form1: TForm1;
-
- implementation
-
- {$R *.DFM}
-
- procedure TForm1.Button1Click(Sender: TObject);
- var ebx, esi, ebp4, ebp8, serial, i : longint;
- s: string[48];
- begin
- ebx:=0;
- esi:=0;
- ebp4:=0;
- ebp8:=0;
- s:=Edit2.text;
- if (length(s)>2) then
- begin
- for i:=1 to length(s) do
- begin
- ebx:=ebx+i*ord(s[i]);
- esi:= 2*esi + ebx;
- ebp4:= ebp4 + ebx + esi + i;
- ebp8:= ebp8 + ebp4 - esi + ebx;
- end; (* end of for *)
-
- serial:= $7FFFFFFF AND ((ebp4*ebp8 + esi) XOR EBX);
- serial:=(serial XOR ebx) - ebx;
-
- Str(serial,s);
- Edit1.text:=s;
- end else
- Edit1.text:='';
- end; (* end of if *)
-
- end.
-